<meta charset="utf-8">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>CTT的日期计算器</title>
<script>

var hzWeek= new Array("日","一","二","三","四","五","六","日");function cweekday(wday){return hzWeek[wday];}

function cala()
{
y=document.getElementById("SY").value;
m=document.getElementById("SM").value;
d=document.getElementById("SD").value;
ddd=document.getElementById("decday").value;

ttt=new Date(y,m-1,d).getTime()+ddd*24000*3600;

theday=new Date();
theday.setTime(ttt);

document.getElementById("result1").innerHTML=theday.getFullYear()+"年"+(1+theday.getMonth())+"月"+theday.getDate()+"日"+"星期"+cweekday(theday.getDay());
}


function calb()
{

y2=document.getElementById("SY2").value;
m2=document.getElementById("SM2").value;
d2=document.getElementById("SD2").value;

y3=document.getElementById("SY3").value;
m3=document.getElementById("SM3").value;
d3=document.getElementById("SD3").value;

day2=new Date(y2,m2-1,d2);
day3=new Date(y3,m3-1,d3);

document.getElementById("result2").innerHTML=(day3-day2)/86400000;
}

</script>
</head>
<img src="./image/login.jpg" width="250" height="150"></br>
<body bgcolor=00FFCC>
<br><br>
<b>日期加减天数:</b>
<br>
　和
<input size=8 id=SY value=2017>年
<input size=4 id=SM value=8>月
<input size=4 id=SD value=9>日
（缺省为今天）
<br>相差
<input size=8 id=decday value=0>天
（输入负数则往前计算）
<br>是：
<span id=result1></span>
<br>
<input type=button value="计算" onclick="cala()">
<br><br>

<b>日期加减日期：</b>
<br>
　　<input size=8 id=SY2 value=2017>年
<input size=4 id=SM2 value=8>月
<input size=4 id=SD2 value=9>日

<br>
和　<input size=8 id=SY3  value=2016>年
<input size=4 id=SM3 value=1>月
<input size=4 id=SD3 value=1>日
<br>相差：
<span id=result2></span>天
<br>
<input type=button value="计算" onclick="calb()">
	<form action="cgi_bin/cgi_math" method="GET">
	    data1:<input type="text" name="data1"></br></br></br>
		data2:<input type="text" name="data2">
		<input type="submit" value="Submit">
	</from>
<br>
<br>
<br>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-2872916894005511";

google_ad_slot = "9228551842";
google_ad_width = 728;
google_ad_height = 90;

</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> 
</script>
</body>
</html>
